package com.eascs.web.p2p.action;



import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.eascs.p2p.common.service.InvestorService;
import com.eascs.p2p.common.vo.ModelResult;
import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;

@RestController
@RequestMapping("/investorRest")
public class InvestorRestController extends BaseRestController {
	
	@Reference
	InvestorService investorService;
	
	@RequestMapping(value="/updateStatus")
	public BaseRestResult<String>  updateStatus(String id,int status) {
		BaseRestResult<String> result = null;
		
			ModelResult<Boolean> model = investorService.updateStatus(id,status);
			if (model.isSuccess()) {
				if (model.getModel()) {
					result = BaseRestResult.warn("操作成功").andRedirect("/investor/index");
					
				}else{
					result = BaseRestResult.error("操作失败");
				}

			}else{
				
				result = BaseRestResult.error("操作失败,数据库发生异常");
			}
			

		
		return result;
	}

}
